<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>const 定义常量</title>
</head>
<body>
    <script>
        //const 用来声明一个常量(值不发生改变的变量) 

        //0. 格式
        // const abc = 100;
        // console.log(abc);

        //1. 声明的时候一定要赋初始值
        // let a; // √
        // var b; // √
        // const c; //X
        //2. 不能修改常量的值
        // const player = 'Uzi';
        // player = 'Jacklove';
        // const PI = 3.14;
        // const API_URL = 'http://api.xiaohigh.com';

        //3. 不允许重复声明
        // const a = 100;
        // const a = 200;

        //4. 块儿级作用域
        // {
        //     const b = 200;
        //     console.log(b);
        // }
        // console.log(b);

        //5. 关于数组和对象的元素的修改 
        const player = {
            name: 'Uzi',
            age: 27,
            height: 170
        }
        //对对象属性的值, 进行修改
        // player.height = '168cm';
        // console.log(player);

        const team = ['A','B','C','D'];
        team.push('E');

        team = 100;
    </script>
</body>
</html>